﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SysModules.aspx.cs" Inherits="Rison.Web.admin.SysModules" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>模块</title>
    <style type="text/css">
        .txtWidth{width:95%;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <table cellpadding="1" cellspacing="1">
            <tr>
                <td><asp:Button ID="btnSave" runat="server" Text="保存" onclick="btnSave_Click" CausesValidation="false" /></td>
                <td><asp:Button ID="btnDelete" runat="server" Text="删除" onclick="btnDelete_Click" /></td>
                <td><asp:Button ID="btnCancel" runat="server" Text="取消" onclick="btnCancel_Click" CausesValidation="false" /></td>
                <td><asp:Label ID="labMsg" runat="server" ForeColor="Red"></asp:Label></td>
            </tr>
        </table><br />
        <asp:LinkButton ID="lbtnMunu" runat="server" Text="一级菜单：" CausesValidation="false"
            style="font-weight:bold;font-size:16px;" onclick="lbtnMunu_Click"></asp:LinkButton>
        <asp:Label ID="labMemu" runat="server" Text="首页" style="font-weight:bold;font-size:16px;"></asp:Label>
        <asp:GridView ID="gvProduct" runat="server" DataKeyNames="PID" 
            AutoGenerateColumns="False" CellPadding="4" ShowFooter="true"
            ForeColor="#333333" GridLines="Both" OnRowCommand="gvProduct_OnRowCommand" OnRowEditing="gvProduct_OnRowEditing">
            <FooterStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="White"/>
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:TemplateField HeaderText="选择" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="标题" HeaderStyle-Width="140px">
                    <ItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="server" Width="125px" Text='<%# DataBinder.Eval(Container.DataItem, "PName")%>' MaxLength="20"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvT" runat="server" Display="Dynamic" ErrorMessage="*" ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtFTitle" runat="server" Width="125px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvFT" runat="server" Display="Dynamic" ErrorMessage="*" ControlToValidate="txtFTitle"></asp:RequiredFieldValidator>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="是否显示" HeaderStyle-Width="70px" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkDisplay" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "Display")%>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="chkDisplay" runat="server" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="顺序" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:TextBox ID="txtOrderId" runat="server" Width="50%" Text='<%# DataBinder.Eval(Container.DataItem, "OrderId")%>'></asp:TextBox>
                        <asp:RangeValidator ID="rvO" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="999" 
                            ControlToValidate="txtOrderId" ErrorMessage="1-999"></asp:RangeValidator>
                    </ItemTemplate>                    
                    <FooterTemplate>
                        <asp:TextBox ID="txtFOrderId" runat="server" Width="50%"></asp:TextBox>
                        <asp:RangeValidator ID="rvFO" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="999" 
                            ControlToValidate="txtFOrderId" ErrorMessage="1-999"></asp:RangeValidator>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="描述" HeaderStyle-Width="360px">
                    <ItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Width="95%" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>' MaxLength="500"></asp:TextBox>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtFDescription" runat="server" Width="95%" MaxLength="500"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnEdit" runat="server" Text="编辑二级菜单" CommandName="Edit" CausesValidation="false"></asp:LinkButton>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="lbtnAppend" runat="server" Text="添加" CommandName="Append"></asp:LinkButton>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />            
        </asp:GridView><asp:Label ID="labCurProductId" runat="server" Visible="false"></asp:Label>
        <asp:GridView ID="gvModules" runat="server" DataKeyNames="MID" 
            AutoGenerateColumns="False" CellPadding="4" ShowFooter="true"
            ForeColor="#333333" GridLines="Both" OnRowCommand="gvModules_OnRowCommand">
            <FooterStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:TemplateField HeaderText="选择" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="标题" HeaderStyle-Width="140px">
                    <ItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="server" Width="125px" Text='<%# DataBinder.Eval(Container.DataItem, "Title")%>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvT" runat="server" Display="Dynamic" ErrorMessage="*" ControlToValidate="txtTitle"></asp:RequiredFieldValidator>
                    </ItemTemplate>               
                    <FooterTemplate>
                        <asp:TextBox ID="txtFTitle" runat="server" Width="125px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvFT" runat="server" Display="Dynamic" ErrorMessage="*" ControlToValidate="txtFTitle"></asp:RequiredFieldValidator>
                    </FooterTemplate>                    
                </asp:TemplateField>
                <asp:ImageField DataImageUrlField="TitleImg" HeaderText="标题图片" HeaderStyle-Width="120px" ></asp:ImageField>                
                <asp:TemplateField HeaderText="是否显示" HeaderStyle-Width="70px" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkDisplay" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem, "Display")%>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="chkDisplay" runat="server" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="显示行数" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:TextBox ID="txtRows" runat="server" Width="50%" Text='<%# DataBinder.Eval(Container.DataItem, "DisplayRows")%>'></asp:TextBox>
                        <asp:RangeValidator ID="rvR" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="20" 
                            ControlToValidate="txtRows" ErrorMessage="5-20"></asp:RangeValidator>
                    </ItemTemplate>                    
                    <FooterTemplate>
                        <asp:TextBox ID="txtFRows" runat="server" Width="50%"></asp:TextBox>
                        <asp:RangeValidator ID="rvFR" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="20" 
                            ControlToValidate="txtFRows" ErrorMessage="5-20"></asp:RangeValidator>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="顺序" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:TextBox ID="txtOrderId" runat="server" Width="50%" Text='<%# DataBinder.Eval(Container.DataItem, "OrderId")%>'></asp:TextBox>
                        <asp:RangeValidator ID="rvO" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="999" 
                            ControlToValidate="txtOrderId" ErrorMessage="1-999"></asp:RangeValidator>
                    </ItemTemplate>                    
                    <FooterTemplate>
                        <asp:TextBox ID="txtFOrderId" runat="server" Width="50%"></asp:TextBox>
                        <asp:RangeValidator ID="rvFO" runat="server" Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="999" 
                            ControlToValidate="txtFOrderId" ErrorMessage="1-999"></asp:RangeValidator>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="描述" HeaderStyle-Width="360px">
                    <ItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Width="95%" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>'></asp:TextBox>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtFDescription" runat="server" Width="95%"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <FooterTemplate>
                        <asp:LinkButton ID="lbtnAppend" runat="server" Text="添加" CommandName="Append"></asp:LinkButton>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </form>
</body>
</html>
